/*************************************************************************
	> File Name: oj-217_score_threshold.cpp
	> Author: Wang Bo
	> Mail: 1276106221@qq.com
	> Created Time: 2020年11月05日 星期四 17时44分46秒
 ************************************************************************/

#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int main() {
    int n, score[100005] = {0};
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> score[i];
    }
    sort(score, score + n);
    vector<int> v(score, score + n);
    auto it = lower_bound(v.begin(), v.end(), score[n / 2]);
    cout << score[n / 2] << " " << v.end() - it;
    return 0;
}
